home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / New System Software Extensions / OpenDoc A6 / SOM / OpenDoc and SOM / IDL / StorageU.idl < prev    next >
Encoding:
Text File  |  1994-04-19  |  6.2 KB  |  253 lines  |  [TEXT/MPS ]

  1. //# Copyright:    © 1993-94 by Apple Computer, Inc., all rights reserved.
  2. #ifndef _STORAGEU_
  3. #define _STORAGEU_
  4.  
  5. #ifndef _ODTYPES_
  6. #include "ODTypes.idl"
  7. #endif
  8.  
  9. #ifndef _ODOBJECT_
  10. #include "ODObject.idl"
  11. #endif
  12.  
  13. #ifndef _REFCTOBJ_
  14. #include "RefCtObj.idl"
  15. #endif
  16.  
  17. //==============================================================================
  18. // Constants
  19. //==============================================================================
  20.  
  21. const ODULong kODPosUndefined = 0xFFFFFFFF;
  22. const ODULong kODPosSame = 0x00;
  23. const ODULong kODPosAll = 1;
  24. const ODULong kODPosFirstSib = 2;
  25. const ODULong kODPosLastSib = 3;
  26. const ODULong kODPosNextSib = 4;
  27. const ODULong kODPosPrevSib = 5;
  28. const ODULong kODPosFirstBelow = 6;
  29. const ODULong kODPosLastBelow = 7;
  30. const ODULong kODPosFirstAbove = 8;
  31. const ODULong kODPosLastAbove = 9;
  32. const ODULong kODPosReserved11 = 10;
  33. const ODULong kODPosReserved12 = 11;
  34. const ODULong kODPosReserved13 = 12;
  35. const ODULong kODPosReserved14 = 13;
  36. const ODULong kODPosReserved15 = 14;
  37. const ODULong kODPosMWrap = 0x10;
  38. const ODULong kODPosMOtherTypes = 0x20;
  39.  
  40.  
  41. const ODID    kODIDAll    = 0;
  42. const ODID    kODIndexAll    = 0;
  43. const ODID    kODIDWild    = 0;
  44. const ODValueType    kODTypeAll = kODNULL;
  45.  
  46. //==============================================================================
  47. // Scalar Types
  48. //==============================================================================
  49.  
  50.  
  51. //==============================================================================
  52. // Classes defined in this interface
  53. //==============================================================================
  54. interface   ODStorageUnit;
  55.  
  56. //==============================================================================
  57. // Classes used by this interface
  58. //==============================================================================
  59. interface   ODDraft;
  60. interface   ODSession;
  61. interface   ODPart;
  62. interface   ODStorageUnitCursor;
  63. interface   ODStorageUnitView;
  64. interface   ODStorageUnitRefIterator;
  65.  
  66. //==============================================================================
  67. // ODStorageUnit
  68. //==============================================================================
  69.  
  70. interface ODStorageUnit :  ODRefCntObject 
  71. {
  72.     void InitStorageUnit(in ODDraft draft,
  73.                         in ODStorageUnitID suid);
  74.     
  75.     ODDraft        GetDraft();
  76.     
  77.     ODSession    GetSession();
  78.     
  79.     ODBoolean    Exists(in ODPropertyName propertyName,
  80.                     in ODValueType valueType, 
  81.                     in ODValueIndex valueIndex);
  82.     
  83.     ODBoolean  ExistsWithCursor(in ODStorageUnitCursor cursor);
  84.     
  85.     ODULong  CountProperties();
  86.     
  87.     ODULong  CountValues();
  88.     
  89.     ODStorageUnit   Focus(in ODPropertyName propertyName,
  90.                             in ODPositionCode propertyPosCode,
  91.                             in ODValueType valueType,
  92.                             in ODValueIndex valueIndex,
  93.                             in ODPositionCode  valuePosCode);
  94.     
  95.     ODStorageUnit   FocusWithCursor(in ODStorageUnitCursor cursor);
  96.     
  97.     ODStorageUnitCursor   CreateCursor();
  98.     
  99.     ODStorageUnit   Externalize();
  100.     
  101.     ODStorageUnit   Internalize();
  102.     
  103.     ODID      GetID();
  104.     
  105.     ODStorageUnitName GetName();
  106.     
  107.     void SetName(in ODStorageUnitName name);
  108.     
  109.     ODStorageUnit   AddProperty(in ODPropertyName propertyName);
  110.     
  111.     ODStorageUnit  AddValue(in ODValueType type);
  112.     
  113.     ODStorageUnit   Remove();
  114.     
  115.     void      CopyTo(in ODStorageUnit toSU);
  116.     
  117.     ODStorageUnit   CloneTo(in ODDraftKey key,
  118.                             in ODDraft destDraft,
  119.                             in ODStorageUnit initiatingFrame);
  120.     
  121.     void      CloneInto(in ODDraftKey key,
  122.                         in ODStorageUnit destStorageUnit,
  123.                         in ODStorageUnit initiatingFrame);
  124.     
  125.     ODStorageUnitView   CreateView(in ODStorageUnitCursor cursor);
  126.     
  127.     ODPropertyName  GetProperty();
  128.     
  129.     ODValueType  GetType();
  130.     
  131.     void      SetType(in ODValueType valueType);
  132.     
  133.     void      SetOffset(in ODULong offset);
  134.     
  135.     ODULong    GetOffset();
  136.     
  137.     ODULong    GetValue(in ODULong length,
  138.                         in ODValue value);
  139.     
  140.     void      SetValue(in ODULong length,
  141.                         in ODValue value);
  142.     
  143.     void      InsertValue(in ODULong length,
  144.                             in ODValue value);
  145.     
  146.     void      DeleteValue(in ODULong length);
  147.     
  148.     ODULong    GetSize();
  149.     
  150.     ODBoolean    IsValidStorageUnitRef(in ODStorageUnitRef aRef);
  151.     
  152.     ODStorageUnitRef  GetStrongStorageUnitRef(in ODStorageUnit embeddedSU);
  153.     
  154.     ODStorageUnitRef  GetWeakStorageUnitRef(in ODStorageUnit embeddedSU);
  155.     
  156.     ODBoolean    IsStrongStorageUnitRef(in ODStorageUnitRef ref);
  157.     
  158.     ODBoolean    IsWeakStorageUnitRef(in ODStorageUnitRef ref);
  159.     
  160.     ODStorageUnit   RemoveStorageUnitRef(in ODStorageUnitRef aRef);
  161.     
  162.     ODStorageUnitID  GetIDFromStorageUnitRef(in ODStorageUnitRef aRef);
  163.     
  164.     ODStorageUnitRefIterator  GetStorageUnitRefIterator();
  165.     
  166.     ODULong      GetGenerationNumber();
  167.     
  168.     ODULong      IncrementGenerationNumber();
  169.     
  170.     ODBoolean  IsPromiseValue();
  171.     
  172.     void    SetPromiseValue(in ODValueType valueType, 
  173.                             in ODULong offset,
  174.                             in ODULong length,
  175.                             in ODValue value, 
  176.                               in ODPart sourcePart);
  177.     
  178.     ODULong  GetPromiseValue(in ODValueType valueType,
  179.                             in ODULong offset,
  180.                             in ODULong length,
  181.                             in ODValue value,
  182.                             in ODPart sourcePart);
  183.     
  184.     void    ClearAllPromises();
  185.     
  186.     ODStorageUnitKey  Lock(in ODStorageUnitKey key);
  187.     
  188.     void        Unlock(in ODStorageUnitKey key);
  189. #ifdef __SOMIDL__
  190.   implementation
  191.   {
  192.     override:
  193.         somInit,
  194.         somUninit,
  195.         IncrementRefCount,
  196.         Release,
  197.         Purge;
  198.     releaseorder:
  199.         InitStorageUnit,
  200.         GetDraft,
  201.         GetSession,
  202.         Exists,
  203.         ExistsWithCursor,
  204.         CountProperties,
  205.         CountValues,
  206.         Focus,
  207.         FocusWithCursor,
  208.         CreateCursor,
  209.         Externalize,
  210.         Internalize,
  211.         GetID,
  212.         GetName,
  213.         SetName,
  214.         AddProperty,
  215.         AddValue,
  216.         Remove,
  217.         CopyTo,
  218.         CloneTo,
  219.         CloneInto,
  220.         CreateView,
  221.         GetProperty,
  222.         GetType,
  223.         SetType,
  224.         SetOffset,
  225.         GetOffset,
  226.         GetValue,
  227.         SetValue,
  228.         InsertValue,
  229.         DeleteValue,
  230.         GetSize,
  231.         IsValidStorageUnitRef,
  232.         GetStrongStorageUnitRef,
  233.         GetWeakStorageUnitRef,
  234.         IsStrongStorageUnitRef,
  235.         IsWeakStorageUnitRef,
  236.         RemoveStorageUnitRef,
  237.         GetIDFromStorageUnitRef,
  238.         GetStorageUnitRefIterator,
  239.         GetGenerationNumber,
  240.         IncrementGenerationNumber,
  241.         IsPromiseValue,
  242.         SetPromiseValue,
  243.         GetPromiseValue,
  244.         ClearAllPromises,
  245.         Lock,
  246.         Unlock;
  247.   };
  248. #endif
  249. };
  250.  
  251. #endif  // _STORAGEU_
  252.  
  253.